home *** CD-ROM | disk | FTP | other *** search
/ Yolanda Bergman's Good Health, Great Food / GoodHealth.iso / pc / yolanda.dxr / Internal_25_simple popup.ls < prev    next >
Encoding:
Text File  |  1998-03-11  |  1.5 KB  |  52 lines

  1. property pFirst, pLAST
  2. global gSpriteNumber
  3.  
  4. on new me
  5.   global SPRITE_GOTO_BTN, SPRITE_GOTO_FIRST, SPRITE_GOTO_LAST, SPRITE_RELATED_BTN, SPRITE_RELATED_FIRST, SPRITE_RELATED_LAST
  6.   case gSpriteNumber of
  7.     SPRITE_GOTO_BTN:
  8.       set pFirst to SPRITE_GOTO_FIRST
  9.       set pLAST to SPRITE_GOTO_LAST
  10.     SPRITE_RELATED_BTN:
  11.       set pFirst to SPRITE_RELATED_FIRST
  12.       set pLAST to SPRITE_RELATED_LAST
  13.   end case
  14.   ActivatePopup(pFirst, pLAST, #SWITCHCAST)
  15.   return me
  16. end
  17.  
  18. on popUpMouseDown me
  19.   set gSpriteNumber to the clickOn
  20.   if (gSpriteNumber >= pFirst) and (gSpriteNumber <= pLAST) then
  21.     puppetSound("mouseDwn.aif")
  22.     downbutton()
  23.   end if
  24. end
  25.  
  26. on popUpMouseUp me
  27.   global CAST_BOOKMARK_BTN, CAST_QUITPOPUP_BTN, SPRITE_GOTO_BTN, gPopupObj, gSavedPopupsL
  28.   if gSpriteNumber <> the clickOn then
  29.     if IsButton() and (getButtonState() = #down) then
  30.       upbutton()
  31.     end if
  32.     exit
  33.   end if
  34.   if (gSpriteNumber < pFirst) or (gSpriteNumber > pLAST) then
  35.     DeactivatePopup(pFirst, pLAST, #SWITCHCAST)
  36.     exit
  37.   end if
  38.   set iButton to the memberNum of sprite gSpriteNumber
  39.   if fCalcButtonCast(iButton, #UP) = CAST_BOOKMARK_BTN then
  40.     pushList(gSavedPopupsL, gPopupObj)
  41.     set gPopupObj to new(script "BOOKMARK POPUP")
  42.     exit
  43.   end if
  44.   if fCalcButtonCast(iButton, #UP) = CAST_QUITPOPUP_BTN then
  45.     pushList(gSavedPopupsL, gPopupObj)
  46.     set gPopupObj to new(script "QUIT POPUP")
  47.     exit
  48.   end if
  49.   DeactivatePopup(pFirst, pLAST, #SWITCHCAST)
  50.   jumpButton()
  51. end
  52.